package com.example.demo.controller;




import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.controller.dto.ResponseDto;
import com.example.demo.dao.CrMapper;
import com.example.demo.entity.Sb;

@RestController
@RequestMapping("/cr")

public class CrController {
    @Resource
    private CrMapper crMapper;
    @GetMapping("/test")
    public String test(){
        return "hello";
    }
    @GetMapping("/find")
    public ResponseDto<?> find(@org.springframework.web.bind.annotation.RequestParam("crr") String crr){

        if(crr.isEmpty()) return new ResponseDto<>(false,"标识不存在",null);
        System.out.println("你好哈哈哈哈哈哈哈"+crr);
        System.out.println(sbif);
        if(sbMapper.selectById(sbif)!=null)
        return new ResponseDto<>(true,"您订阅的标识"+sbif+"信息有变动",sbMapper.selectById(sbif));
        return new ResponseDto<>(true,null,sbMapper.selectById(sbif));
    }
}
